package image;

import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.Highgui;
import org.opencv.imgproc.Imgproc;

public class ImageProcessing {

	private static Mat m;
	private static Mat m_gauss;
	private static Mat m_sobel;
	
	public static void main(String[] args) {
		System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
		
		m = Highgui.imread("image/Disque.png", Highgui.CV_LOAD_IMAGE_GRAYSCALE);
		m_gauss = Mat.zeros(new Size(640, 480), CvType.CV_8UC1);
		m_sobel = Mat.zeros(new Size(640, 480), CvType.CV_8UC1);
		
		Imgproc.GaussianBlur(m, m_gauss, new Size(5, 5), 0, 0);
		
		Imgproc.Sobel(m_gauss, m_sobel, CvType.CV_8UC1, 1, 1);
		
		//new LoadImage("image/tmp1.png", m, "Image Origine", true);
		//new LoadImage("image/tmp2.png", m_gauss, "Gauss", true);
		new LoadImage("image/tmp3.png", m_sobel, "Sobel", true, 0, 0);
	}

}
